﻿<Window x:Class="TagFlo.SmartSetDialog"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:c="clr-namespace:TagFlo"

    Title="TagFlo" Height="410" Width="600"
    ResizeMode="NoResize" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d"
    >
	<Window.Resources>


		<!--<c:ComparisonTypeConverter x:Key="ComparisonTypeConverter"/>
		<c:FilterTypeConverter x:Key="FilterTypeConverter"/>-->


		<DataTemplate x:Key="ButtonCell">
			<StackPanel Orientation="Horizontal">
				<Button x:Name="RemoveRuleButton" Width="20" Click="RemoveRuleButton_Click" >-</Button>
			</StackPanel>
			</DataTemplate>
	</Window.Resources>
	<Grid>

		<Grid.ColumnDefinitions>
			<ColumnDefinition Width="0.283*"/>
    		<ColumnDefinition Width="0.717*"/>
    	</Grid.ColumnDefinitions>
    	<ListBox Margin="8,37.96,8,66" x:Name="SmartSetListBox" IsSynchronizedWithCurrentItem="True" SelectionChanged="SmartSetListBox_SelectionChanged"  ItemsSource="{Binding}" DisplayMemberPath="SmartSetName"/>
    	<TextBox Margin="8,0,60.623,33.96" VerticalAlignment="Bottom" Text="" x:Name="SmartSetNameTextBox" TextWrapping="Wrap" d:LayoutOverrides="VerticalAlignment, Height"/>
    	<Button Content="Add..." HorizontalAlignment="Right" Margin="0,0,8,33.96" x:Name="AddButton" VerticalAlignment="Bottom" Width="48.623" Click="AddButton_Click" d:LayoutOverrides="Height"/>
    	<Button Content="Remove" HorizontalAlignment="Right" VerticalAlignment="Bottom" Width="48.623" Margin="0,0,8,8" x:Name="RemoveButton" Click="RemoveButton_Click"/>
    	<ListView Margin="8,63.92,8,8" x:Name="RulesListView" IsSynchronizedWithCurrentItem="True" Grid.Column="1" ItemsSource="{Binding}">
		<ListView.View>
    			<GridView>
					<GridViewColumn DisplayMemberBinding=
                        "{Binding Path=FilterType}"
				Header="Filter" Width="100"/>
					<GridViewColumn DisplayMemberBinding=
                        "{Binding Path=ComparisonType}" 
									Header="Comparison" Width="100"/>
					<GridViewColumn DisplayMemberBinding=
                        "{Binding Path=FilterValue}"
									Header="Value"/>
					<GridViewColumn CellTemplate="{StaticResource ButtonCell}" />
						
				</GridView>
    		</ListView.View>
    	</ListView>
    	<Label Content="Rules:" Margin="8,8,36.623,0" VerticalAlignment="Top" Grid.Column="1"/>
    	<Button Content="+" HorizontalAlignment="Right" Margin="0,37.96,8,0" VerticalAlignment="Top" Grid.Column="1" Width="24.623" Height="21.96" x:Name="AddRuleButton" Click="AddRuleButton_Click"/>

		<ComboBox HorizontalAlignment="Left" ItemsSource="{Binding}" DisplayMemberPath="Name" VerticalAlignment="Top" IsSynchronizedWithCurrentItem="True" Grid.Column="1" Margin="8,37.96,0,0" Width="110" x:Name="FilterTypeComboBox" SelectionChanged="FilterTypeComboBox_SelectionChanged"/>
    		
    	
		<ComboBox Margin="122,37.96,185.898,0" ItemsSource="{Binding ElementName=FilterTypeComboBox, Path=SelectionBoxItem.ComparisonList}" DisplayMemberPath="Name" VerticalAlignment="Top" Height="21.96" IsSynchronizedWithCurrentItem="True" Grid.Column="1" x:Name="ComparisonComboBox"/>
		<!--ItemsSource="{Binding}"-->

		<ComboBox HorizontalAlignment="Right" Margin="0,37.96,36.623,0" VerticalAlignment="Top" Width="145.275" Height="21.96" IsSynchronizedWithCurrentItem="True" Grid.Column="1" IsEditable="True" x:Name="FilterValueComboBox"/>
    	<Label Content="Smart Sets:" VerticalAlignment="Top" Margin="8,8,8,0"/>
    	<Path Fill="#FFFFFFFF" Stretch="Fill" Stroke="#FF000000" HorizontalAlignment="Left" Margin="-0.102,10,0,0" VerticalAlignment="Top" Width="1" Height="1" Grid.Column="1" Data="M168,10"/>
        
    </Grid>
</Window>
